/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ihmprojet.view.transformer;

import ihmprojet.core.model.Sommet;
import java.awt.Stroke;
import javax.swing.Icon;
import org.apache.commons.collections15.Transformer;

/**
 *
 * @author nell
 */
public class SommetIconTransformer implements Transformer<Sommet, Icon> {

    private IconLoader loader;

    public SommetIconTransformer(IconLoader loader) {
        this.loader = loader;
    }

    @Override
    public Icon transform(Sommet s) {
        Icon i = loader.getIconFor(s.getType());
        if (i == null) {
            i = loader.getIconFor(Sommet.Type.ABSTRACTION);
        }

        return i;
    }
}
